package com.sanyue.springboot.config;

import com.sanyue.springboot.bean.Monster;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

/**
 * 第二个配置类
 * 和spring可以配置多个ioc一样，springboot配置类也可以有多个
 * 补充：配置文件是多个，但是配置容器是一个
 * 如何理解：如果我们在BeanConfig02配置了bean-monster01，在BeanConfig也配置了bean-monster01
 * 则会报错：he bean 'monster01', defined in class path resource
 *          A bean with that name has already been defined in class path resource
 * @author: Guan
 **/
@Configuration
public class BeanConfig02 {
    @Bean
    public Monster monster02(){
        return new Monster(100,"dr",300,"eat");
    }
}
